public class Traversal {
    public static void traversal(StudentInfo[]arr) {
        //遍历学生信息
        System.out.println("学生的信息为:");
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == null) {

            } else {
                System.out.println("[" + "ID:" + arr[i].getId() + "  " +
                        "姓名:" + arr[i].getName() + "  " + "年龄:" + arr[i].getAge() + "]");
            }
        }
    }
}
